package com.myjoje.controller.tencent;

import com.myjoje.service.tencent.CosService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

/**
 * 腾讯云对象存储
 * 文件下载使用FileController即可
 */
@Controller()
@RequestMapping("/tencent/cos")
public class CosController {

    @Autowired
    private CosService cosService;


    /**
     * 上传文件
     */
    @RequestMapping("/upload")
    public Object upload(@RequestParam("file") MultipartFile multipartFile) throws Exception {
        return cosService.uploadFile(multipartFile);
    }


}
